
<?
print realpath(".");

$test = "http://s97505153.onlinehome.us/pimp/makevirtual.php";




print_r (urlinfo($test));

include ("includes/actions/act_xml_parser.php");
$x=arrayfromxml("http://www.ebpro.info/jcaa/xml/eb.xml");
print "<xmp>"; 
$z=array();
while (list($a,$b)=each($x))
{
    if ($b[0]=="calendar")
	{
	//  $param_name = $b[2]["name"];
	  print_r($b);
		 //print "\n---------------\n".$param_name."\n---------------\n";
		// print count($z); 
		 
	}
    if ($b[0]=="item")
	{
	  // print "\n---------------\n".$param_name."\n---------------\n";
	  // print_r($b);
	   $z[count($z)] = $b;
		 // $s = "INSERT INTO ebp_event_property_items (display_text,display_value) VALUES ('".$b[2]["name"]."','".$b[2]["type"]."','".$b[2]["each"]."') \n";
		
	}
}
exit;
$dirname = $_POST["dirname"];
$url = $_POST["url"];
if ($dirname=="") {
?>
 
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<html>
<head>
<title>Make Virtual Directory</title>
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">
</head>

<body>
<form method="post">Enter folder path:<br>
<input name=dirname size="75"><br>Enter URL:<br>
<input name=url size="75"><br>
<input type=submit value="Create">
</form>
</body>
</html>


<a href="index.php">home</a>

<?
} else {
	$dh = opendir( $dirname ) or die ("couldn't open directory $dirname"); 
	 $folders=array();
	 $names=array();
	while (! ( ( $file = readdir ( $dh ) ) == false ) ) { 	
				 
		 if (isreadable ($file)) {
			       $files [count($files)] = $file;  
			    } 
		 
		
	}
	
	 
	closedir( $dh );  
	print "<xmp>";
	

	sort ($files);
	
	print "url=$url\n";
	for ($e=0;$e<count($files);$e++) {
		$fullpath=$dirname."/".$files[$e];
		$fn = $files[$e];
		$fs = filesize($fullpath);  
		$ft = my_content_type($fullpath); 
		$fd = date("F d Y H:i:s.", filemtime ($fullpath)); 

		print "name=$fn&size=$fs&type=$ft&date=$fd\n";
	}
	print "\n\n--------------------------------------------------------\n\n";
}

function isreadable ($path) {
 //   $filetype = exif_imagetype($path);
	$isok = false;
	 
    if (strpos($path,"workcopy")>0) {
	    // work copy image 
	} else if (strpos(strtolower($path),".jpg")>0) {
	     $isok = true;
	} else if (strpos(strtolower($path),".png")>0) {
	     $isok = true;
	} else if (strpos(strtolower($path),".gif")>0) {
	     $isok = true;
	} 
	return $isok;
}

function my_content_type ($path) {
 //   $filetype = exif_imagetype($path);
	$isok = "unknown";
	 
    if (strpos(strtolower($path),".jpg")>0) {
	     $isok = "jpg";
	} else if (strpos(strtolower($path),".png")>0) {
	     $isok = "png";
	} else if (strpos(strtolower($path),".gif")>0) {
	     $isok = "gif";
	} 
	return $isok;
}

?>

